Skip to content

add terraform code for doccano service and conf file changes for nginx#31

Open
bekuchicago wants to merge 9 commits into
pcdc_devfrom
GEAR-330
Open

add terraform code for doccano service and conf file changes for nginx#31
bekuchicago wants to merge 9 commits into
pcdc_devfrom
GEAR-330

Conversation

@bekuchicago

Copy link
Copy Markdown

No description provided.

Comment thread docker/Dockerfile.nginx Outdated
Comment thread docker/nginx/default.conf Outdated
@grugna

grugna commented May 27, 2025

Copy link
Copy Markdown

Could you move the RDS folder / module in the terraform_modules repo and then import it here?

Just trying to keep the modules in the same place so we can re-use more of them with rewriting or copying and pasting around.

@grugna

grugna commented May 27, 2025

Copy link
Copy Markdown

Also move the EFS modules in that repo and make the "path" configurable / variables.

@grugna

grugna commented Jun 9, 2025

Copy link
Copy Markdown

new terraform_module version is 0.5.0

@grugna

grugna commented Jun 18, 2025

Copy link
Copy Markdown

testing locally I reverted this change so I could run the docker compose. Was there a reason behind it to make it localhost?
image

@bekuchicago

Copy link
Copy Markdown
Author

testing locally I reverted this change so I could run the docker compose. Was there a reason behind it to make it localhost? image

the proxy_pass value needs to be "localhost", as all containers are in the same task in ECS. probably it would be better to have separate nginx conf files

}

variable "private_subnet_ids" {
default = ["subnet-02daaea0d231975df", "subnet-0c7f4570d0c82bdc3"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be in the tfvars, we shouldn't default to them.

}

variable "vpc_id" {
default = "vpc-0e20603ab3c8dd65e" #doccano dev vpc

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in the tfvars, we shouldn't default to it.

Comment thread terraform/dev/main.tf
app_name = "doccano"
vpc_id = var.vpc_id
subnet_ids = var.private_subnet_ids
acm_cert_arn = "arn:aws:acm:us-east-1:471835990085:certificate/c1cebe37-738d-4766-a635-bc23d3e8caa7" #

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, this should be a variable, we shouldn't hardcode it.

Comment thread terraform/dev/main.tf
@@ -0,0 +1,87 @@
module "doccano_ecs" {
source = "../modules/ecs"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you defining a new module here instead of using https://github.com/chicagopcdc/terraform_modules/tree/main/aws/ecs?

Is it a use case that is hard to generalize and parametrize?
If so that is good, otherwise we should try to move the module to the terraform module repo and import it here so we can reuse it for other projects.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I will update this to use module with reference to terraform_modules repo, initially I thought local reference was more appropriate

Comment thread terraform/dev/main.tf
resource "aws_ssm_parameter" "DATABASE_URL" {
name = "/${var.environment}/${var.app_name}/DATABASE_URL"
type = "SecureString"
value = "postgres://doccano:${module.rds.rds_random_password}@${module.rds.rds_enpoint}/doccano?sslmode=disable"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is rds_enpoint just a typo here or is it carried from the imported module output?

Comment thread terraform/dev/main.tf
resource "aws_ssm_parameter" "DATABASE_URL" {
name = "/${var.environment}/${var.app_name}/DATABASE_URL"
type = "SecureString"
value = "postgres://doccano:${module.rds.rds_random_password}@${module.rds.rds_enpoint}/doccano?sslmode=disable"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update sslmode=require instead of disable. The new version of RDS enforce the SSL.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, it was just taken from current values at the time

@grugna

grugna commented Jul 8, 2026

Copy link
Copy Markdown

Can you add some outputs like:

  • ALB DNS name
  • URL
  • ECS service names
  • RDS endpoint
  • EFS ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants